$(document).ready(function () {

    $(".lg-form-select").each(function () {
        var that = $(this)
        that.find(".lg-select-title").click(function () {
            that.toggleClass("lg-form-selected")
        })
    });
    $(".lg-form-checkbox").each(function () {
        var that = $(this)
        that.click(function () {
            $(this).toggleClass("lg-form-checked")
        })
    });
    $(".lg-form-radio").each(function () {
        var that = $(this)
        that.click(function () {
            if (that.hasClass("lg-radio-disbaled")) {
                return;
            } else {
                $(this).addClass("lg-form-radioed").siblings(".lg-form-radio").removeClass("lg-form-radioed")
                $(this).siblings(".lg-form-radio").find("i").removeClass("fa-dot-circle-o").addClass("fa-circle-o")
                $(this).find("i").addClass("fa-dot-circle-o")
            }
        })
    });
    $(".lg-form-switch").each(function () {
        var that = $(this)
        var judgeClass = function () {
            var arr = that.data("tips").split("|")
            var a = arr[0]
            var b = arr[1]
            if (that.hasClass("lg-form-onswitch")) {
                that.find("span").html(a)
            } else {
                that.find("span").html(b)
            }
        }
        judgeClass()
        that.click(function () {
            that.toggleClass('lg-form-onswitch')
            judgeClass();
        })
    });
    $(".lg-sign-slide-button").click(function () {
        $(this).find('ul').toggle();
        $(this).find('span').toggleClass('act');
    });
})